import React from 'react'
import { useColumns } from './TableColumns'
interface ReturnTimeTableProps {
  title?: string
  tableData?: any[]
}
import './index.less'
import { Table } from 'antd'
import dayjs from 'dayjs'
const ReturnTimeTable: React.FC<ReturnTimeTableProps> = ({ tableData }) => {
  const currentYear = dayjs().month() + 1 >= 3 ? dayjs().year() : dayjs().year() - 1
  return (
    <div className="desk_return_time_table">
      <div className="table-title">{currentYear}年度返单时效</div>
      <div className="table-main-wrap">
        <div className="table-main-table">
          <Table
            bordered
            size="small"
            pagination={false}
            rowHoverable={false}
            scroll={{ x: '100%', y: 155 }}
            dataSource={tableData || []}
            columns={useColumns({ tableData: tableData || [] })}
            rowKey={(rows) => rows?.trackOrderPersonWorkId + (rows?.bigClassId || '')}
          ></Table>
        </div>
      </div>
    </div>
  )
}

export default ReturnTimeTable
